<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <button @click="fn">按钮</button>
        <div v-if="isShow" id="abc">123</div>
    </div>
    <script src="./node_modules/vue/dist/vue.js"></script>
    <script>
        var vm = new Vue({
            el:'#app',
            data:{
                isShow:false 
            },
            methods:{
                fn(){
                    this.isShow = true 
                    // console.log(document.getElementById('abc'))
                    // setTimeout(function(){
                    //     console.log(document.getElementById('abc'))
                    // },1000)
                    this.$nextTick(()=>{
                        console.log(document.getElementById('abc'))
                    })
                }
            }
        })
    </script>
</body>
</html>
